<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<c:if test="${not empty stu}">
		<form action="UpdateStuServlet" method="post">
			<input type="hidden" name="sId" value="${stu.sId}"/>
			<div>
				<label for="stuName">姓名:</label>
				<input type="text" id="stuName" value="${stu.sName}" name="sName" placeholder="Enter Stu Name" required="required"/>
				<span id="stuNameTips"></span>
			</div>
			<div>
				<label for="stuAge">年龄:</label>
				<input type="text" id="stuAge" name="sAge" value="${stu.sAge}"placeholder="Enter Stu Age" required="required"/>
				<span id="stuAgeTips"></span>
			</div>
			<div>
				<label for="stuGender">性别:</label>
				男<input type="radio" id="stuGender" name="sGender" value="男" <c:if test="${stu.sGender == '男'}">checked="checked"</c:if>/>
				女<input type="radio" name="sGender" value="女" <c:if test="${stu.sGender == '女'}">checked="checked"</c:if>/>
			</div> 
			<div>
				<label for="stuHobby">爱好:</label>
				<input type="checkbox" name="sHobby" value="足球" <c:if test="${fn:contains(stu.sHobby,'足球')}">checked="checked"</c:if>/>足球
				<input type="checkbox" name="sHobby" value="篮球" <c:if test="${fn:contains(stu.sHobby,'篮球')}">checked="checked"</c:if>/>篮球
				<input type="checkbox" name="sHobby" value="排球" <c:if test="${fn:contains(stu.sHobby,'排球')}">checked="checked"</c:if>/>排球
				<input type="checkbox" name="sHobby" value="网球" <c:if test="${fn:contains(stu.sHobby,'网球')}">checked="checked"</c:if>/>网球
			</div>
			<input type="submit" value="修改"/>
		</form>
	</c:if>	
</body>
</html>